package com.neusoft.neuiotms.dcom.model.insurance;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@Table(name = "neuiot_insurance_register_unit")
@org.hibernate.annotations.Table(appliesTo = "neuiot_insurance_register_unit", comment = "重保服务登记单位表")
public class InsuranceRegisterUnit extends AbstractAuditModel {

    private static final long serialVersionUID = -7930645507187054272L;

    /** 单位编码 */
    @NotBlank(message = "单位编码不能为空")
    @Length(max = 255, message = "单位编码不能超过{max}位")
    @Column(length = 255)
    @Comment("varchar(255) NOT NULL COMMENT '单位编码'")
    private String unitCode;

    /** 单位名称 */
    @NotBlank(message = "单位名称不能为空")
    @Length(max = 255, message = "单位名称不能超过{max}位")
    @Column(length = 255)
    @Comment("varchar(255) NOT NULL COMMENT '单位名称'")
    private String unitName;

    /** 关联服务登记 */
    @ManyToOne
    private InsuranceRegister insuranceRegister;

}
